using UnityEngine;

public static class TransformExtensions
{
	public static Transform Search(this Transform target, string name)
	{
		if (target.name == name)
		{
			return target;
		}
		for (int i = 0; i < target.childCount; i++)
		{
			Transform transform = target.GetChild(i).Search(name);
			if (transform != null)
			{
				return transform;
			}
		}
		return null;
	}
}
